<template>
    <div>
      <button @click="get">_+++++_</button>
      <MyCount ref="getcount" />
      <hr>
      <MyHeader />
    </div>

</template>

<script>
//引入就要用，不然会报错
import MyCount from './components/MyCount';
import MyHeader from './components/MyHeader';
export default {
  name:"APP",
  components:{
    MyCount,
    MyHeader
  },
  methods:{
    get(){
      //如果把ref绑定在对应的组件上面 那么￥refs.xxxx 返回的就是就是这个组件实例
      console.log(this.$refs.getcount);
    }
  }
}
</script>

<style>

</style>